<!--
 * @Author: huangximian huangximian@e-ling.com.cn
 * @Date: 2022-05-20 11:48:58
 * @LastEditors: huangximian huangximian@e-ling.com.cn
 * @LastEditTime: 2022-05-26 18:19:06
 * @FilePath: \jcyy-official-website\src\App.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div id="app">
    <div class="container">
      <template v-if="ismOrpc == 'PCoperation'">
        <router-view />
      </template>
      <template v-else>
        <router-view />
      </template>
    </div>
  </div>
</template>

<script>
export default {
  name: "App",
  components: {
  },
  created() {
    if (this._isMobile()) {
      //手机端
      this.ismOrpc = "Moperation";
      // let path = this.$route.path; //先获取路由路径
      this.$router.push('/'); //再跳转路由路径，query参数没带过去，所以被清除了
    } else {
      //pc端
      this.ismOrpc = "PCoperation";
    }
  },
  methods: {
    //判断手机端还是PC端
    _isMobile() {
      let flag = navigator.userAgent.match(
        /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
      );
      return flag;
    },
  },
};
</script>

<style>
#app {
}
</style>
